package com.foodplus.www.model.impl;

import com.foodplus.www.api.RetrofitManager;
import com.foodplus.www.bean.shop.ShopBean;
import com.foodplus.www.bean.shop.ShopTagBean;
import com.foodplus.www.model.IShopModel;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by WangZhiChao on 2016/10/31.
 */

public class ShopModelImpl implements IShopModel {


    @Override
    public void getShopData(Subscriber<ShopBean> subscriber, Map<String, String> params) {
        RetrofitManager
                .getInstance()
                .getShopService()
                .getShopData(params)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    @Override
    public void getShopTagData(Subscriber<ShopTagBean> subscriber, Map<String, String> params) {
        RetrofitManager
                .getInstance()
                .getShopService()
                .getShopTagData(params)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }
}
